package com.meida.module.bus.provider.service;


import com.meida.common.mybatis.base.service.IBaseService;
import com.meida.common.mybatis.entity.EntityMap;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.module.bus.client.entity.BusMaterialPlan100;
import com.meida.module.bus.client.entity.BusPurchase;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 100材料计划表 接口
 *
 * @author flyme
 * @date 2020-10-09
 */
public interface BusMaterialPlan100Service extends IBaseService<BusMaterialPlan100> {


    /**
     * 100开口订单下达
     *
     * @param
     * @param
     * @return
     */

    ResultBody updateMaterial(Long projrctId, Long versionId, BusPurchase purchase) throws Exception;

    /*
    *Oa审核成功，更新项目为审核中的数据为审核成功
     */
    Boolean goApplyStatus(Long projectId, Integer applayStatus);



    ResultBody copyAndUpdateplan(Map map);



    /**
     * @return
     */
    List<EntityMap> selectInnerOrder(Long purchaseId, Long materialPlanId);


    /**
     * 转存200
     * @param materialPlanIds
     * @return
     */

    ResultBody transferedVersion( Long[] materialPlanIds,Long projectId);


    /**
     * 判断当前版本是否可操作修改变更材料计划
     * @param projectId
     * @return
     */
     boolean isOpentorVersStatus(Long projectId,String  versionType);

    /**
     * 根据类型更新材料数据
     * @param projectId
     * @param planType
     * @param applayStatus
     * @return
     */
    Boolean updateApplayStatus(Long projectId, Integer planType, Integer applayStatus);




     List<Long> getPlanIds(Long projectId);


    List<Long> getinitPlanIds(Long projectId);


    List<EntityMap> initDataplans(Map map);

    List<EntityMap> initPurchseDataplans(Map map);



   ResultBody importOnUpdateplan100Data(MultipartFile file, Map params);




    ResultBody import100PurseDetail(MultipartFile file, Map params);


    /**
     * 合并数据
     * @param map
     * @return
     */
    ResultBody mergeplan100(Map map);

    //oa 审核成功后进行合并操作
    ResultBody goMerge100(Integer checkState,Long projectId) throws Exception;
    /**
     * 转存200前验证
     * @param projectId
     * @param versionStatus
     * @return
     */
    int totalProjectAndVersionStatus(Long projectId, Integer versionStatus);

    /**
     * 材料100所有版本信息
     * @param map
     * @return
     */
    List<EntityMap> selectVersionList(Map map);



    ResultBody goVersion200(Integer checkState, Long projectId);

    /**
     * 材料申请审批状态
     * @param projectId
     * @return
     */
    Boolean updatepurseApplayStatus(Long projectId,List<BusMaterialPlan100> plan100s);


    /**
     * 材料申请审核后调用
     * @param projectId
     * @return
     */
    ResultBody goPurseSuccess(Integer checkState, Long projectId,List<BusMaterialPlan100> plan100List,BusPurchase purchase, String userNm);
}
